
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spShippingStatusReportGetPaymentNotPaidList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [spShippingStatusReportGetPaymentNotPaidList]
GO

CREATE PROCEDURE spShippingStatusReportGetPaymentNotPaidList

AS

SELECT
	[ShippingStatusReport].[ID],
	[REQ],
	[OrderDate],
	[ContainerSize],
	[LP],
	[PONo_Office],
	[PONo_Type],
	[PONo_Supplier],
	[PONo_Number],
	[IsPrimary],
	[PONo_Consolidation],
	[AccNo],
	[CustomerOrLocation],
	[FinalDestination],
	[Description],
	[FactoryETD],
	[ShippingDate],
	[ShippingLine],
	[Vessel],
	[ContainerNo],
	[ETA],
	[Week],
	[ArrivalPort],
	[PI],
	[Payment],
	[DocReceived],
	[CompletedDate],
	[BulkType],
	[ModifiedDate],
	[BulkOrderNo],
	[PayAuth],
	[ContainerDeliveried],
	[POInOpera],
	[InvValue],
	[PayDate],
	[Remarks],
	[SInvoiced],
	[SuppOrderNo],
	[OfficeID],
	[CustPONo],
	[OnHold],
	[BulkOrderOfficeID],
	[SInvoicedPd],
	[Catalogue],
	[ShippingLineID],
	[CatalogID],
	[PDepValue],
	[SalesOrder],
	[SalesInvoiceValue],
	[SalesInvoiceDate],
	[SalesPaymentDue],
	[TargetETD]
FROM
	[ShippingStatusReport] 
WHERE [Payment] <> 'F' AND [Payment] <> 'P' AND [Payment] <> 'C'
	AND ShippingDate IS NOT NULL AND ShippingDate > '1/1/1900' AND DATEDIFF(day, ShippingDate, getdate()) > 14
ORDER BY ShippingDate


GO

	
 